package com.game;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;

/*
* 爆炸类
* */
public class Explode extends GameObject{
    //爆炸图集
    private int length = 50;
    static Image[] img = new Image[7];
    int explodeCount = 0;

    //往图集里添加图片
    static {
        for (int i = 0; i < 7; i++){
            img[i] = Toolkit.getDefaultToolkit().getImage("image/explode/"+ (i+1) +".gif");
        }
    }

    public Explode(String img, int x, int y, GamePanel gamePanel) {
        super(img, x, y, gamePanel);
    }

    @Override
    public void paintSelf(Graphics g) {
        /*if (explodeCount < 7){
            g.drawImage(img[explodeCount],x,y,null);
            explodeCount++;
        }*/
        g.drawImage(getImg(),x,y,length,length,null);
    }

    @Override
    public Rectangle gerRec() {
        return null;
    }
}
